"use strict";
cc._RF.push(module, 'f1b08ZTIxZPa5E1oE6/KYi2', 'GoldFlyAnim');
// scripts/GoldFlyAnim.js

"use strict";

var t = require;
var e = module;
var o = exports;

var _i,
    n = void 0 && (void 0).__extends || (_i = function i(t, e) {
  return (_i = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _i(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    a = void 0 && (void 0).__decorate || function (t, e, o, i) {
  var n,
      a = arguments.length,
      r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);else for (var s = t.length - 1; s >= 0; s--) {
    (n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
  }
  return a > 3 && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(o, "__esModule", {
  value: !0
}), o.Fly_Type = void 0;
var r = t("Util"),
    s = cc._decorator,
    l = s.ccclass,
    c = s.property;
o.Fly_Type = {
  Default: 0,
  Gold: 1,
  Diammond: 2,
  consumeGreen: 3,
  consumeBlue: 4,
  consumePurple: 5,
  consumeGolden: 6,
  consumeRed: 7,
  vit: 8
};

var d = function (t) {
  function e() {
    var e = null !== t && t.apply(this, arguments) || this;
    return e.arrNode_Icon = new Array(8), e;
  }

  return n(e, t), e.prototype.resetView = function () {
    for (var t = 0; t < this.arrNode_Icon.length; t++) {
      this.arrNode_Icon[t].stopAllActions(), this.arrNode_Icon[t].active = !1;
    }

    this.node.active = !1, this.node.destroy();
  }, e.prototype.showIconType = function (t) {
    for (var e = (t = t || 1) - 1, o = 0; o < this.arrNode_Icon.length; o++) {
      this.arrNode_Icon[o].active = !1;
    }

    return this.arrNode_Icon[e].active = !0, this.arrNode_Icon[e];
  }, e.prototype.playAnim = function (t, e, o, i, n, a) {
    var s = this;
    this.node.active = !0;
    var l = this.showIconType(a);
    l.position = cc.v3(0, 0, 0);
    var c;
    c = t == e - 1 ? .55 : 0 == t ? .3 : r.Util.getRandomInt(0, 20) / 100 + .3;
    var d = l.parent.convertToNodeSpaceAR(o),
        h = r.Util.getRandomInt(50, 100),
        p = r.Util.getRandomInt(50, 100);
    h = h % 2 == 1 ? -h : h, p % 2 == 1 ? p += 25 : p -= 100;
    var u = cc.v3(h, p);
    l.stopAllActions(), cc.tween(l).to(c, {
      position: u
    }).to(.8, {
      position: d
    }).call(function () {
      s.node.active = !1, 0 == t && i && i(), t == e - 1 && n && n(), s.resetView();
    }).start();
  }, a([c(cc.Node)], e.prototype, "arrNode_Icon", void 0), a([l], e);
}(cc.Component);

o["default"] = d;

cc._RF.pop();